home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_100
/
187_01
/
detabs.c
< prev
next >
Wrap
Text File
|
1985-12-28
|
1KB
|
37 lines
/*@*****************************************************/
/*@ */
/*@ detabs - remove tabs from input string. */
/*@ Assumes a fixed tab interval. */
/*@ */
/*@ Usage: detabs(out, in, interval, omax); */
/*@ where out is the output string area. */
/*@ in is the input string area. */
/*@ interval is the fixed tab interval. */
/*@ omax is the max output area size. */
/*@ */
/*@*****************************************************/
detabs(bufo,bufi,tabsize,omax) /* remove tabs from input string */
char bufi[], bufo[];
int tabsize, omax;
{
char c;
int ii, io;
ii = io = 0;
while ((c = bufi[ii++]) && io < omax) /* till end of string */
if (c == '\t') {
bufo[io++] = ' ';
while ((io % tabsize) && io < omax) /* space to next tab */
bufo[io++] = ' ';
}
else
bufo[io++] = c;
bufo[io] = '\0';
}